package com.ruoqing.core.dto;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;


/**
	* @author YaoXian
	* @title: BaseResponse
	* @projectName ruoxi-blog
	* @description: 若兮微服务 - 用户服务 - dto数据传输对象父类
	* @date 2020-11-15 14:24
	*/
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public class BaseResponse {
		@XmlElement
		/** 返回结果状态标识码，ok表示成功,error表示错误 */
		private String status;
		
		@XmlElement
		private String message;
		
		public void setMessage(String message) {
				this.message = message;
		}
		
		public String getMessage() {
				return message;
		}
		
		public String getStatus() {
				return status;
		}
		
		public void setStatus(String status) {
				this.status = status;
		}
		
		public BaseResponse(String status, String message) {
				this.status = status;
				this.message = message;
		}
		
		public BaseResponse(String status) {
				this.status = status;
		}
		
		public BaseResponse() {
		}
		
		public static BaseResponse buildResponse(String status,String msg){
				BaseResponse baseResponse = new BaseResponse();
				baseResponse.setMessage(msg);
				baseResponse.setStatus(status);
				return baseResponse;
		}
		
		public static BaseResponse buildResponse(String status){
				BaseResponse baseResponse = new BaseResponse();
				baseResponse.setStatus(status);
				return baseResponse;
		}
}